<template>
    <div>
        <van-row type="flex" justify="space-around" class="row" >
            <van-col span="6" v-for="(item,i) in productlist" :key="i">
                <dl @click="todo(i)">
                    <dt><img :src="item.pimg" alt=""></dt>
                    <dd>
                        <h4>{{item.pname}}</h4>
                        <p>会员价￥{{item.pprice}}</p>
                    </dd>
                </dl>
            </van-col>
          
        </van-row>
    </div>
</template>

<script>
import Axios from 'axios';
    export default {
        name:'Best',
        data() {
            return {
               
        productlist:[

        ]
            }
        },
        methods: {
            todo(index){
                this.$router.push('/buyinterface?id='+parseInt(index+1))
            }
        },
        mounted() {
            let that = this
            Axios({
                url:'http://jx.xuzhixiang.top/ap/api/productlist.php',
                params:{uid:11299}
            }).then(function(data){
                that.productlist = data.data.data
            })
        },
      
    }
</script>

<style scoped>
    .row{
        font-size: 12px;
        width: 100%;
        text-align: center;
        flex-wrap: wrap;
        display: flex;
        justify-content: flex-start;
        padding-left: 28px
    }
    .row img{
        width: 86px;
        height: 86px;
        border-radius: 10px
    }
    .van-col{
        margin: 10px;
        overflow: hidden;
        height: 124px;
        font-size: 10px;
        
    }
</style>